﻿<%@ Page Title="" Language="C#" MasterPageFile="~/doanh_nghiep/DNAdminLayout.master" AutoEventWireup="true" CodeFile="khuyen_mai_cho_duyet.aspx.cs" Inherits="doanh_nghiep_khuyen_mai_cho_duyet" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="block" id="block-lists">
        <div class="content">
            <h2 class="title">
                Các khuyến mãi đang chờ được duyệt</h2>
            <div class="inner">
            <div class="group">
                    <label>
                        Từ khóa:&nbsp; </label>
                <asp:TextBox ID="tbxKeys" runat="server" class="text_field" size="60"></asp:TextBox>
                    &nbsp;
                    <button class="button slim-button" type="submit">
                    <img src="./images/search.png" alt="Tìm kiếm">
                        Tìm kiếm</button >
                
                </div>
                <br />
                <asp:ListView ID="ListView1" runat="server" DataKeyNames="id" 
                    DataSourceID="SqlDataSourceKhuyenMaiDangApDung">
                 
                    <EditItemTemplate>
                        <td id="Td1" runat="server" style="">
                            id:
                            <asp:Label ID="idLabel1" runat="server" Text='<%# Eval("id") %>' />
                            <br />id_doanh_nghiep:
                            <asp:TextBox ID="id_doanh_nghiepTextBox" runat="server" 
                                Text='<%# Bind("id_doanh_nghiep") %>' />
                            <br />id_the_loai:
                            <asp:TextBox ID="id_the_loaiTextBox" runat="server" 
                                Text='<%# Bind("id_the_loai") %>' />
                            <br />ten_sp:
                            <asp:TextBox ID="ten_spTextBox" runat="server" Text='<%# Bind("ten_sp") %>' />
                            <br />mo_ta_sp:
                            <asp:TextBox ID="mo_ta_spTextBox" runat="server" 
                                Text='<%# Bind("mo_ta_sp") %>' />
                            <br />gia_goc:
                            <asp:TextBox ID="gia_gocTextBox" runat="server" Text='<%# Bind("gia_goc") %>' />
                            <br />gia_km:
                            <asp:TextBox ID="gia_kmTextBox" runat="server" Text='<%# Bind("gia_km") %>' />
                            <br />ngay_bat_dau:
                            <asp:TextBox ID="ngay_bat_dauTextBox" runat="server" 
                                Text='<%# Bind("ngay_bat_dau") %>' />
                            <br />ngay_ket_thuc:
                            <asp:TextBox ID="ngay_ket_thucTextBox" runat="server" 
                                Text='<%# Bind("ngay_ket_thuc") %>' />
                            <br />so_luong_toi_da:
                            <asp:TextBox ID="so_luong_toi_daTextBox" runat="server" 
                                Text='<%# Bind("so_luong_toi_da") %>' />
                            <br />so_luong_toi_thieu:
                            <asp:TextBox ID="so_luong_toi_thieuTextBox" runat="server" 
                                Text='<%# Bind("so_luong_toi_thieu") %>' />
                            <br />noi_dung:
                            <asp:TextBox ID="noi_dungTextBox" runat="server" 
                                Text='<%# Bind("noi_dung") %>' />
                            <br />dieu_kien_ap_dung:
                            <asp:TextBox ID="dieu_kien_ap_dungTextBox" runat="server" 
                                Text='<%# Bind("dieu_kien_ap_dung") %>' />
                            <br />dac_trung:
                            <asp:TextBox ID="dac_trungTextBox" runat="server" 
                                Text='<%# Bind("dac_trung") %>' />
                            <br />anh_1:
                            <asp:TextBox ID="anh_1TextBox" runat="server" Text='<%# Bind("anh_1") %>' />
                            <br />anh_2:
                            <asp:TextBox ID="anh_2TextBox" runat="server" Text='<%# Bind("anh_2") %>' />
                            <br />anh_3:
                            <asp:TextBox ID="anh_3TextBox" runat="server" Text='<%# Bind("anh_3") %>' />
                            <br />anh_4:
                            <asp:TextBox ID="anh_4TextBox" runat="server" Text='<%# Bind("anh_4") %>' />
                            <br />anh_5:
                            <asp:TextBox ID="anh_5TextBox" runat="server" Text='<%# Bind("anh_5") %>' />
                            <br />da_duoc_duyet:
                            <asp:TextBox ID="da_duoc_duyetTextBox" runat="server" 
                                Text='<%# Bind("da_duoc_duyet") %>' />
                            <br />
                            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                                Text="Update" />
                            <br />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                                Text="Cancel" />
                            <br />
                        </td>
                    </EditItemTemplate>
                    <EmptyDataTemplate>
                        <table id="Table1" runat="server" style="">
                            <tr>
                                <td>
                                    No data was returned.</td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                    <EmptyItemTemplate>
                <td id="Td2" runat="server" />
                    </EmptyItemTemplate>
                    <GroupTemplate>
                        <tr ID="itemPlaceholderContainer" runat="server">
                            <td ID="itemPlaceholder" runat="server">
                            </td>
                        </tr>
                    </GroupTemplate>
                    
                    <ItemTemplate>
                        <td id="Td3" runat="server" style="padding: 15px 0px;border-bottom: 1px solid #DDD;">
                            <div class="left">
                                <a href="./chi_tiet_khuyen_mai.aspx?id=<%# Eval("id") %>">
                                    <img class="avatar" src='../upload/<%# Eval("anh_1") %>' alt="product" width="120" /></a>
                            </div>
                            <div class="item" style="margin-left:150px;vertical-align:top;" >
                                <p style="margin: 0px;">
                                <a class="item-header" href="./chi_tiet_khuyen_mai.aspx?id=<%# Eval("id") %>"><%# Eval("ten_sp") %></a><a style="float: right;position: relative;top: -17px;color: blue;" href="dn_cap_nhat_km.aspx?id=<%# Eval("id") %>">Cập nhật</a>
                                    <%# Eval("mo_ta_sp") %>.</p>
                            </div>                          
                        </td>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <table id="Table2" runat="server" width="100%">
                            <tr id="Tr1" runat="server">
                                <td id="Td4" runat="server">
                                    <table ID="groupPlaceholderContainer" runat="server" border="0" style="width:100%">
                                        <tr ID="groupPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr id="Tr2" runat="server">
                                <td id="Td5" runat="server" style="">
                                    <asp:DataPager ID="DataPager1" runat="server" PageSize="12">
                                        <Fields>
                                            <asp:NextPreviousPagerField FirstPageText="Đầu tiên" LastPageText="Cuối cùng" NextPageText="Tiếp theo" PreviousPageText="Trang trước" ButtonType="Button" ShowFirstPageButton="True" 
                                                ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                            <asp:NumericPagerField />
                                            <asp:NextPreviousPagerField FirstPageText="Đầu tiên" LastPageText="Cuối cùng" NextPageText="Tiếp theo" PreviousPageText="Trang trước" ButtonType="Button" ShowLastPageButton="True" 
                                                ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                        </Fields>
                                    </asp:DataPager>
                                </td>
                            </tr>
                        </table>
                    </LayoutTemplate>
                    <SelectedItemTemplate>
                        <td id="Td6" runat="server" style="">
                            id:
                            <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                            <br />id_doanh_nghiep:
                            <asp:Label ID="id_doanh_nghiepLabel" runat="server" 
                                Text='<%# Eval("id_doanh_nghiep") %>' />
                            <br />id_the_loai:
                            <asp:Label ID="id_the_loaiLabel" runat="server" 
                                Text='<%# Eval("id_the_loai") %>' />
                            <br />ten_sp:
                            <asp:Label ID="ten_spLabel" runat="server" Text='<%# Eval("ten_sp") %>' />
                            <br />mo_ta_sp:
                            <asp:Label ID="mo_ta_spLabel" runat="server" Text='<%# Eval("mo_ta_sp") %>' />
                            <br />gia_goc:
                            <asp:Label ID="gia_gocLabel" runat="server" Text='<%# Eval("gia_goc") %>' />
                            <br />gia_km:
                            <asp:Label ID="gia_kmLabel" runat="server" Text='<%# Eval("gia_km") %>' />
                            <br />ngay_bat_dau:
                            <asp:Label ID="ngay_bat_dauLabel" runat="server" 
                                Text='<%# Eval("ngay_bat_dau") %>' />
                            <br />ngay_ket_thuc:
                            <asp:Label ID="ngay_ket_thucLabel" runat="server" 
                                Text='<%# Eval("ngay_ket_thuc") %>' />
                            <br />so_luong_toi_da:
                            <asp:Label ID="so_luong_toi_daLabel" runat="server" 
                                Text='<%# Eval("so_luong_toi_da") %>' />
                            <br />so_luong_toi_thieu:
                            <asp:Label ID="so_luong_toi_thieuLabel" runat="server" 
                                Text='<%# Eval("so_luong_toi_thieu") %>' />
                            <br />noi_dung:
                            <asp:Label ID="noi_dungLabel" runat="server" Text='<%# Eval("noi_dung") %>' />
                            <br />dieu_kien_ap_dung:
                            <asp:Label ID="dieu_kien_ap_dungLabel" runat="server" 
                                Text='<%# Eval("dieu_kien_ap_dung") %>' />
                            <br />dac_trung:
                            <asp:Label ID="dac_trungLabel" runat="server" Text='<%# Eval("dac_trung") %>' />
                            <br />anh_1:
                            <asp:Label ID="anh_1Label" runat="server" Text='<%# Eval("anh_1") %>' />
                            <br />anh_2:
                            <asp:Label ID="anh_2Label" runat="server" Text='<%# Eval("anh_2") %>' />
                            <br />anh_3:
                            <asp:Label ID="anh_3Label" runat="server" Text='<%# Eval("anh_3") %>' />
                            <br />anh_4:
                            <asp:Label ID="anh_4Label" runat="server" Text='<%# Eval("anh_4") %>' />
                            <br />anh_5:
                            <asp:Label ID="anh_5Label" runat="server" Text='<%# Eval("anh_5") %>' />
                            <br />da_duoc_duyet:
                            <asp:Label ID="da_duoc_duyetLabel" runat="server" 
                                Text='<%# Eval("da_duoc_duyet") %>' />
                            <br />
                        </td>
                    </SelectedItemTemplate>
                </asp:ListView>

                <asp:SqlDataSource ID="SqlDataSourceKhuyenMaiDangApDung" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:babydealConnectionString %>" 
                    
                    
                    SelectCommand="SELECT id, id_doanh_nghiep, id_the_loai, ten_sp, mo_ta_sp, gia_goc, gia_km, ngay_bat_dau, ngay_ket_thuc, so_luong_toi_da, so_luong_toi_thieu, noi_dung, dieu_kien_ap_dung, dac_trung, anh_1, anh_2, anh_3, anh_4, anh_5, da_duoc_duyet FROM khuyen_mai WHERE (id_doanh_nghiep = @id_doanh_nghiep) AND da_duoc_duyet = 0 AND (ten_sp LIKE '%' + @ten_san_pham + '%')">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="0" Name="id_doanh_nghiep" 
                            SessionField="IDDoanhNghiep" Type="Int32" />
                        <asp:ControlParameter ControlID="tbxKeys" DefaultValue="%%" Name="ten_san_pham" 
                            PropertyName="Text" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </div>
        </div>
    </div>

     
</asp:Content>

